-- GENERATED SPELL FOR [Coilfang Leper] --


function spell0_21338(pUnit, Event) --@Cleave,n/a--
pUnit:FullCastSpellOnTarget(40505,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21338', 585, 1)
end

function spell1_21338(pUnit, Event) --@Fire Blast,n/a--
pUnit:FullCastSpellOnTarget(13339,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21338', 599, 1)
end

function spell2_21338(pUnit, Event) --@Fire Blast,n/a--
pUnit:FullCastSpellOnTarget(14145,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21338', 575, 1)
end

function spell3_21338(pUnit, Event) --@Frost Nova,Self--
pUnit:FullCastSpellOnTarget(11831,pUnit)
pUnit:RegisterEvent('Sorts_21338', 8298, 1)
end

function spell4_21338(pUnit, Event) --@Frost Nova,Self--
pUnit:FullCastSpellOnTarget(15063,pUnit)
pUnit:RegisterEvent('Sorts_21338', 8275, 1)
end

function spell5_21338(pUnit, Event) --@Heal,Heal--
pUnit:FullCastSpellOnTarget(11642,pUnit)
pUnit:RegisterEvent('Sorts_21338', 3500, 1)
end

function spell6_21338(pUnit, Event) --@Heal,Heal--
pUnit:FullCastSpellOnTarget(15586,pUnit)
pUnit:RegisterEvent('Sorts_21338', 3500, 1)
end

function spell7_21338(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(9613,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21338', 3000, 1)
end

function spell8_21338(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(12739,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21338', 3000, 1)
end

function spell9_21338(pUnit, Event) --@Shoot,n/a--
pUnit:FullCastSpellOnTarget(15547,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21338', 533, 1)
end

function spell10_21338(pUnit, Event) --@Shoot,n/a--
pUnit:FullCastSpellOnTarget(16100,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21338', 617, 1)
end

function spell11_21338(pUnit, Event) --@Strike,n/a--
pUnit:FullCastSpellOnTarget(13446,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21338', 578, 1)
end

function spell12_21338(pUnit, Event) --@Sunder Armor,n/a--
pUnit:FullCastSpellOnTarget(13444,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21338', 30297, 1)
end

function Sorts_21338(pUnit, Event)
local choix_sorts_21338 = math.random(0, 12)
if choix_sorts_21338 == 0 then
pUnit:RegisterEvent('spell0_21338', 1, 1)
end
if choix_sorts_21338 == 1 then
pUnit:RegisterEvent('spell1_21338', 1, 1)
end
if choix_sorts_21338 == 2 then
pUnit:RegisterEvent('spell2_21338', 1, 1)
end
if choix_sorts_21338 == 3 then
pUnit:RegisterEvent('spell3_21338', 1, 1)
end
if choix_sorts_21338 == 4 then
pUnit:RegisterEvent('spell4_21338', 1, 1)
end
if choix_sorts_21338 == 5 then
pUnit:RegisterEvent('spell5_21338', 1, 1)
end
if choix_sorts_21338 == 6 then
pUnit:RegisterEvent('spell6_21338', 1, 1)
end
if choix_sorts_21338 == 7 then
pUnit:RegisterEvent('spell7_21338', 1, 1)
end
if choix_sorts_21338 == 8 then
pUnit:RegisterEvent('spell8_21338', 1, 1)
end
if choix_sorts_21338 == 9 then
pUnit:RegisterEvent('spell9_21338', 1, 1)
end
if choix_sorts_21338 == 10 then
pUnit:RegisterEvent('spell10_21338', 1, 1)
end
if choix_sorts_21338 == 11 then
pUnit:RegisterEvent('spell11_21338', 1, 1)
end
if choix_sorts_21338 == 12 then
pUnit:RegisterEvent('spell12_21338', 1, 1)
end
end

function mob21338_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_21338', math.random(1500, 3000), 1)
end

function mob21338_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21338_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21338_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(21338, 1, 'mob21338_Action')
RegisterUnitEvent(21338, 2, 'mob21338_Leave')
RegisterUnitEvent(21338, 3, 'mob21338_Kill')
RegisterUnitEvent(21338, 4, 'mob21338_Die')
